#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
using namespace std;

class Solution {
public:
    vector<double> vd;
    vector<int> vi;
    void Insert(int num)
    {
        vi.push_back(num);
    }

    double GetMedian()
    {
        sort(vi.begin(), vi.end());
        int n = vi.size();
        if (n & 1)
        {
            return double(vi[n >> 1]);
        }
        else
        {
            return double(vi[n >> 1] + vi[(n - 1) >> 1]) / 2;
        }
    }

};